#pragma once

#include <memory>
#include "Noncopyable.h"

// Define the PImpl (Point to implementation) action class
// It's a noncopyable class as reference class(not a value class),
// so you can not use the assign operator constructor 
// or copy / move constructor
class PImpl : public Noncopyable
{
public:
	//  ... all public and protected stuff goes here ...

	PImpl(void);
	virtual ~PImpl(void);

	// ... we export a Print interface for using

	void print(void);
	void swap(PImpl&);

private:
	// opaque type here ...
	
	class Impl; std::unique_ptr<Impl> _impl;
};

void PImplAction(void);
void PImpSwapAction(void);

// Recap:
// The pimpl idiom is a modern C++ technique to hide implementation, to minimize coupling, 
// and to separate interfaces. 

// Here's how the pimpl idiom can improve the software development lifecycle:
//		* Minimization of compilation dependencies.
//		* Separation of interface and implementation.
//		* Portability.



